/**
 * \file project.h
 * \brief Funções que permitem dar a noção de projecto
 */

# ifndef PROJECT_DEF
# define PROJECT_DEF

# define PROJECT_PATH "projects"

# include "../../io/cmd/cmd.h"
# include "../../util/lists/array-list.h"
# include "../../io/files/uces/parser.h"
# include "../../io/files/students/parser.h"
# include "../../io/files/config/config.h"
# include <dirent.h>
# include <sys/types.h>
# include <sys/stat.h>
# include <fcntl.h>
# include <unistd.h>


typedef struct {
	char *name;
	ArrayList *students;
	ChainingHashMap *ucesMap;
	LinkedList *configs;
} Project;

/**
 * \brief Da a lista de alunos até ao momento
 * \return lista
 */
ArrayList * getStudentsList ();
/**
 * \brief Da o mapa de UCEs existente
 * \return mapa
 */
ChainingHashMap * getUCEsMap ();
/**
 * \brief Da a lista de configurações
 */
LinkedList * getConfigurationList ();
/**
 * \brief Para quando se efectuar alterações ao projecto.
 */
void setProjectUnsaved ();
/**
 * \brief Permite saber se actualmente existe um projecto carregado
 */
int hasProject();
char * getProjectName();
/**
 * \brief vai buscar uma configuração à lista
 */
char * getConfigurationValue (const char *name);
/**
 * \brief Inicializa o sistema de projectos
 */
void initializeProjectSystem ();
/**
 * \brief Lista os projectos existentes
 */
CommandResult * command_listProjects (int argc, char *argv[]);
/**
 * \brief Guarda o projecto actual
 */
CommandResult * command_saveProject (int argc, char *argv[]);
/**
 * \brief abre um projecto gravado
 */
CommandResult * command_openProject (int argc, char *argv[]);
/**
 * \brief mostra o nome do projecto actual
 */
CommandResult * command_actualProject (int argc, char *argv[]);
/**
 * \brief inicia um projecto novo
 */
CommandResult * command_newProject (int argc,char *argv[]);

CommandResult * command_setConfig (int argc, char *argv[]);
CommandResult * command_listConfigs (int argc, char *argv[]);
CommandResult * command_showConfig (int argc, char *argv[]);
CommandResult * command_exit (int argc, char *argv[]);
# endif
